In some electronic devices such as computers, water-cooled servers are generally adopted to improve the performance of the electronic devices. One of the biggest security concerns in the electronic devices equipped with the water-cooled server is a cooling water leak. At present, the industry mostly responds by water leak alarm to hand the cooling water leak in the water-cooled server, i.e., setting an alarm system in the electronic devices. After the alarm system is alarmed due to the water leak, an operator manually turns off the water-cooled server and related devices. However, such a coping style requires human involvement, which leads to complicated operation, low efficiency and slow response to the water leak.